#include<stdio.h>
#include<math.h>
int main()
{
	double n1,n2,t;
	double num;
	int i,j;
	while( scanf("%lf",&n1)!=EOF )
	{
		scanf("%lf",&n2);
		if( n1<n2 )
		{
			t=n1;n1=n2;n2=t;
		}
		//printf("%.5lf\n",( sqrt(5.0)+1 )/2);
		num=( n1-n2 )*( sqrt(5.0)+1 )/2;
		if( fabs(num-n2) <= 1 )
				printf("0\n");
		else	printf("1\n"); 
	}
	return 0;
}
